<?php

class LinkWidget  extends CWidget
{

	public function init()
	{
		parent::init();
	}

	public function run()
	{
		$data=Yii::app()->cache->get('web-links');
		if($data===false)
		{
			$data = Yii::app()->db->createCommand()
				->select('name,url')
				->from('edu_link')
				->order('sort,createtime desc')
				->limit(30)
				->queryAll();
			Yii::app()->cache->set('web-links',$data);
		}
		$this->render("link",array("links"=>$data));
	}
}

?>